<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Class Topic
 * @package App\Models
 * @property string $type 主题类型
 */
class Topic extends Model
{
    public $table = 'qz_topic';

    public $guarded = ['id'];

    public $timestamps = false;

    public function group()
    {
        return $this->belongsTo(Group::class);
    }

    public function user()
    {
        return $this->belongsTo(UcenterMember::class);
    }

    public function isArticle()
    {
        return $this->type == 'article';
    }
}
